<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    
    <title>nmrglue.glue &mdash; nmrglue v1.0 documentation</title>
    <link rel="stylesheet" href="../_static/sphinxdoc.css" type="text/css" />
    <link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
    <script type="text/javascript">
      var DOCUMENTATION_OPTIONS = {
        URL_ROOT:    '../',
        VERSION:     '1.0',
        COLLAPSE_MODINDEX: false,
        FILE_SUFFIX: '.html',
        HAS_SOURCE:  true
      };
    </script>
    <script type="text/javascript" src="../_static/jquery.js"></script>
    <script type="text/javascript" src="../_static/doctools.js"></script>
    <link rel="top" title="nmrglue v1.0 documentation" href="../index.html" />
    <link rel="up" title="Reference Guide" href="index.html" />
    <link rel="next" title="nmrglue.fileiobase" href="fileiobase.html" />
    <link rel="prev" title="nmrglue.convert" href="convert.html" /> 
  </head>
  <body>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             accesskey="I">index</a></li>
        <li class="right" >
          <a href="../modindex.html" title="Global Module Index"
             accesskey="M">modules</a> |</li>
        <li class="right" >
          <a href="fileiobase.html" title="nmrglue.fileiobase"
             accesskey="N">next</a> |</li>
        <li class="right" >
          <a href="convert.html" title="nmrglue.convert"
             accesskey="P">previous</a> |</li>
        <li><a href="../index.html">nmrglue v1.0 documentation</a> &raquo;</li>
          <li><a href="index.html" accesskey="U">Reference Guide</a> &raquo;</li> 
      </ul>
    </div>
      <div class="sphinxsidebar">
        <div class="sphinxsidebarwrapper">
            <h3><a href="../index.html">Table Of Contents</a></h3>
            <ul>
<li><a class="reference external" href="#">nmrglue.glue</a><ul>
<li><a class="reference external" href="#high-level-functions">High-Level Functions</a></li>
<li><a class="reference external" href="#low-level-functions">Low-Level Functions</a></li>
<li><a class="reference external" href="#low-level-classes">Low-Level Classes</a></li>
</ul>
</li>
</ul>

            <h4>Previous topic</h4>
            <p class="topless"><a href="convert.html"
                                  title="previous chapter">nmrglue.convert</a></p>
            <h4>Next topic</h4>
            <p class="topless"><a href="fileiobase.html"
                                  title="next chapter">nmrglue.fileiobase</a></p>
            <h3>This Page</h3>
            <ul class="this-page-menu">
              <li><a href="../_sources/reference/glue.txt"
                     rel="nofollow">Show Source</a></li>
            </ul>
          <div id="searchbox" style="display: none">
            <h3>Quick search</h3>
              <form class="search" action="../search.html" method="get">
                <input type="text" name="q" size="18" />
                <input type="submit" value="Go" />
                <input type="hidden" name="check_keywords" value="yes" />
                <input type="hidden" name="area" value="default" />
              </form>
              <p class="searchtip" style="font-size: 90%">
              Enter search terms or a module, class or function name.
              </p>
          </div>
          <script type="text/javascript">$('#searchbox').show(0);</script>
        </div>
      </div>

    <div class="document">
      <div class="documentwrapper">
        <div class="bodywrapper">
          <div class="body">
            
  <div class="section" id="module-nmrglue.fileio.glue">
<h1>nmrglue.glue<a class="headerlink" href="#module-nmrglue.fileio.glue" title="Permalink to this headline">¶</a></h1>
<p>Functions for reading and writing spectral data to the glue format which 
stores spectral data in the Hierarchical Data Format (HDF5).</p>
<p>glue files are HDF5 files with the spectral data stored in a dataset names 
&#8216;spectrum&#8217; and any parameters stored in the dataset attributes.  At minimum
the parameter dictionary must contain a ndim key with the dimentionality of
the data and a dictionry for each axis numbered (0,1,2...) with the following 
keys:</p>
<table border="1" class="docutils">
<colgroup>
<col width="13%" />
<col width="87%" />
</colgroup>
<thead valign="bottom">
<tr><th class="head">Key</th>
<th class="head">Description</th>
</tr>
</thead>
<tbody valign="top">
<tr><td>car</td>
<td>Carrier freqiency in Hz</td>
</tr>
<tr><td>complex</td>
<td>True for complex data, False for magnitude</td>
</tr>
<tr><td>encoding</td>
<td>type of encoding, &#8216;states&#8217;, &#8216;tppi&#8217;, &#8216;direct&#8217;, etc</td>
</tr>
<tr><td>freq</td>
<td>True for frequency domain data, False otherwise</td>
</tr>
<tr><td>label</td>
<td>Axis label, (&#8216;13C&#8217;, etc)</td>
</tr>
<tr><td>obs</td>
<td>Observation frequency in MHz</td>
</tr>
<tr><td>size</td>
<td>Dimension size (R|I for direct dim, R+I for indirect)</td>
</tr>
<tr><td>sw</td>
<td>Spectral width in Hz</td>
</tr>
<tr><td>time</td>
<td>True for time domain data, False otherwise</td>
</tr>
</tbody>
</table>
<p>This modules is imported as nmrglue.glue and can be called as such.</p>
<div class="section" id="high-level-functions">
<h2>High-Level Functions<a class="headerlink" href="#high-level-functions" title="Permalink to this headline">¶</a></h2>
<p>These are the functions the majority of users will use from the glue module.</p>
<dl class="function">
<dt id="nmrglue.fileio.glue.read">
<tt class="descclassname">nmrglue.fileio.glue.</tt><tt class="descname">read</tt><big>(</big><em>filename</em>, <em>dataset='spectrum'</em><big>)</big><a class="headerlink" href="#nmrglue.fileio.glue.read" title="Permalink to this definition">¶</a></dt>
<dd>Read a glue file</dd></dl>

<dl class="function">
<dt id="nmrglue.fileio.glue.read_lowmem">
<tt class="descclassname">nmrglue.fileio.glue.</tt><tt class="descname">read_lowmem</tt><big>(</big><em>filename</em>, <em>dataset='spectrum'</em><big>)</big><a class="headerlink" href="#nmrglue.fileio.glue.read_lowmem" title="Permalink to this definition">¶</a></dt>
<dd>Read a glue file using mimimal memory usage</dd></dl>

<dl class="function">
<dt id="nmrglue.fileio.glue.write">
<tt class="descclassname">nmrglue.fileio.glue.</tt><tt class="descname">write</tt><big>(</big><em>filename</em>, <em>dic</em>, <em>data</em>, <em>dataset='spectrum'</em>, <em>overwrite=False</em><big>)</big><a class="headerlink" href="#nmrglue.fileio.glue.write" title="Permalink to this definition">¶</a></dt>
<dd>Write dic,data pair to a HDF5 file</dd></dl>

<dl class="function">
<dt id="nmrglue.fileio.glue.make_uc">
<tt class="descclassname">nmrglue.fileio.glue.</tt><tt class="descname">make_uc</tt><big>(</big><em>dic</em>, <em>data</em>, <em>dim=-1</em><big>)</big><a class="headerlink" href="#nmrglue.fileio.glue.make_uc" title="Permalink to this definition">¶</a></dt>
<dd>make a unit conversion object</dd></dl>

<dl class="function">
<dt id="nmrglue.fileio.glue.guess_udic">
<tt class="descclassname">nmrglue.fileio.glue.</tt><tt class="descname">guess_udic</tt><big>(</big><em>dic</em>, <em>data</em><big>)</big><a class="headerlink" href="#nmrglue.fileio.glue.guess_udic" title="Permalink to this definition">¶</a></dt>
<dd>Guess parameters of a universal dictionary from dic,data pair</dd></dl>

<dl class="function">
<dt id="nmrglue.fileio.glue.create_dic">
<tt class="descclassname">nmrglue.fileio.glue.</tt><tt class="descname">create_dic</tt><big>(</big><em>udic</em><big>)</big><a class="headerlink" href="#nmrglue.fileio.glue.create_dic" title="Permalink to this definition">¶</a></dt>
<dd>Create a glue dictionary from a universal dictionary</dd></dl>

</div>
<div class="section" id="low-level-functions">
<h2>Low-Level Functions<a class="headerlink" href="#low-level-functions" title="Permalink to this headline">¶</a></h2>
<p>These functions are typically not used directly by users.  They are called by
high level functions.  Developers and user who want fine control over glue
files will be interested in these functions.</p>
<dl class="function">
<dt id="nmrglue.fileio.glue.create_data">
<tt class="descclassname">nmrglue.fileio.glue.</tt><tt class="descname">create_data</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#nmrglue.fileio.glue.create_data" title="Permalink to this definition">¶</a></dt>
<dd>Create glue data array (return data)</dd></dl>

<dl class="function">
<dt id="nmrglue.fileio.glue.wrap_data">
<tt class="descclassname">nmrglue.fileio.glue.</tt><tt class="descname">wrap_data</tt><big>(</big><em>data</em><big>)</big><a class="headerlink" href="#nmrglue.fileio.glue.wrap_data" title="Permalink to this definition">¶</a></dt>
<dd>wrap h5py.highlevel.Dataset objects into a more numpy like object</dd></dl>

<dl class="function">
<dt id="nmrglue.fileio.glue.get_dic">
<tt class="descclassname">nmrglue.fileio.glue.</tt><tt class="descname">get_dic</tt><big>(</big><em>f</em>, <em>dataset='spectrum'</em><big>)</big><a class="headerlink" href="#nmrglue.fileio.glue.get_dic" title="Permalink to this definition">¶</a></dt>
<dd>Get a dictionary from dataset in a HDF5 File</dd></dl>

<dl class="function">
<dt id="nmrglue.fileio.glue.put_dic">
<tt class="descclassname">nmrglue.fileio.glue.</tt><tt class="descname">put_dic</tt><big>(</big><em>f</em>, <em>dic</em>, <em>dataset='spectrum'</em><big>)</big><a class="headerlink" href="#nmrglue.fileio.glue.put_dic" title="Permalink to this definition">¶</a></dt>
<dd>Put a dictionary to the dataset in a HDF5 File</dd></dl>

</div>
<div class="section" id="low-level-classes">
<h2>Low-Level Classes<a class="headerlink" href="#low-level-classes" title="Permalink to this headline">¶</a></h2>
<dl class="class">
<dt id="nmrglue.fileio.glue.glue_2d">
<em class="property">class </em><tt class="descclassname">nmrglue.fileio.glue.</tt><tt class="descname">glue_2d</tt><big>(</big><em>Dataset</em>, <em>order=</em><span class="optional">[</span>, <em>'y'</em>, <em>'x'</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#nmrglue.fileio.glue.glue_2d" title="Permalink to this definition">¶</a></dt>
<dd><p>glue_2d emulates numpy.ndarray objects without loading data into memory</p>
<ul class="simple">
<li>slicing operations return ndarray objects.</li>
<li>can iterate over with expected results.</li>
<li>transpose and swapaxes functions create a new fid_2d object with the
new axes ordering.</li>
<li>has ndim, shape, and dtype attributes.</li>
</ul>
</dd></dl>

<dl class="class">
<dt id="nmrglue.fileio.glue.glue_3d">
<em class="property">class </em><tt class="descclassname">nmrglue.fileio.glue.</tt><tt class="descname">glue_3d</tt><big>(</big><em>Dataset</em>, <em>order=</em><span class="optional">[</span>, <em>'z'</em>, <em>'y'</em>, <em>'x'</em><span class="optional">]</span><big>)</big><a class="headerlink" href="#nmrglue.fileio.glue.glue_3d" title="Permalink to this definition">¶</a></dt>
<dd><p>glue_3d emulates numpy.ndarray objects without loading data into memory</p>
<ul class="simple">
<li>slicing operations return ndarray objects.</li>
<li>can iterate over with expected results.</li>
<li>transpose and swapaxes functions create a new fid_2d object with the
new axes ordering.</li>
<li>has ndim, shape, and dtype attributes.</li>
</ul>
</dd></dl>

</div>
</div>


          </div>
        </div>
      </div>
      <div class="clearer"></div>
    </div>
    <div class="related">
      <h3>Navigation</h3>
      <ul>
        <li class="right" style="margin-right: 10px">
          <a href="../genindex.html" title="General Index"
             >index</a></li>
        <li class="right" >
          <a href="../modindex.html" title="Global Module Index"
             >modules</a> |</li>
        <li class="right" >
          <a href="fileiobase.html" title="nmrglue.fileiobase"
             >next</a> |</li>
        <li class="right" >
          <a href="convert.html" title="nmrglue.convert"
             >previous</a> |</li>
        <li><a href="../index.html">nmrglue v1.0 documentation</a> &raquo;</li>
          <li><a href="index.html" >Reference Guide</a> &raquo;</li> 
      </ul>
    </div>
    <div class="footer">
      &copy; Copyright 2010, Jonathan J. Helmus.
      Last updated on Oct 29, 2010.
      Created using <a href="http://sphinx.pocoo.org/">Sphinx</a> 0.6.4.
    </div>
  </body>
</html>